package com.mi.system.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mi.system.dto.query.RoleQueryDTO;
import com.mi.system.dto.request.RoleRequestDTO;
import com.mi.system.entity.Role;
import com.mi.system.vo.RoleVO;

import java.util.List;

/**
 * Role service
 *
 * @author jin_huaquan
 * @version 1.0
 * @date 2021/11/1 13:55
 */
public interface RoleService extends IService<Role> {

    /**
     * list role
     *
     * @param page  分页信息
     * @param query query params
     * @return role list
     */
    IPage<RoleVO> listRole(Page page, RoleQueryDTO query);

    /**
     * list role
     *
     * @param query query params
     * @return role list
     */
    List<RoleVO> listRole(RoleQueryDTO query);

    /**
     * save role
     *
     * @param request role info
     * @return result
     */
    boolean saveRole(RoleRequestDTO request);

    /**
     * update role
     *
     * @param id      role id
     * @param request role info
     * @return result
     */
    boolean updateRole(Long id, RoleRequestDTO request);

    /**
     * remove role
     *
     * @param id role id
     * @return result
     */
    Role removeRole(Long id);
}